word order hackerrank solution python